package com.zxx.pattern.decoratorPattern.decorator2;

/**
 * @author zxx on 2021/7/13
 */
public class TestDecorator2 {
    public static void main(String[] args) {
        Component component = new ConcreteComponent();
        component.doSomething();
        System.out.println("------1------");

        Component component1 = new ConcreteDecorator1(component);
        component1.doSomething();
        System.out.println("-------2-----");

        Component component2 = new ConcreteDecorator2(component1);
        component2.doSomething();
    }
}
